/*
 * File:   Move.h
 * Author: root
 *
 * Created on November 15, 2008, 9:21 PM
 */

#include "CCard.h"

#ifndef _MOVE_H
#define	_MOVE_H

struct Move {

    bool knock;
    CCard cardDrawn;
    CCard cardPicked;
    CCard cardDiscarded;

    Move() {
        knock = false;
        cardDrawn.SetIdx(53);
        cardPicked.SetIdx(53);
        cardDiscarded.SetIdx(53);
    }

    Move(bool knocked, CCard drawnCard, CCard pickedCard, CCard discardedCard) {
        knock = knocked;
        cardDrawn.SetIdx(drawnCard.GetIndex());
        cardPicked.SetIdx(pickedCard.GetIndex());
        cardDiscarded.SetIdx(discardedCard.GetIndex());
    }

    Move(bool knocked, int drawnCard, int pickedCard, int discardedCard) {
      knock = knocked;
      cardDrawn.SetIdx(drawnCard);
      cardPicked.SetIdx(pickedCard);
      cardDiscarded.SetIdx(discardedCard);
    }

    Move(const Move& move) {
        knock = move.knock;
        cardDrawn.SetIdx(move.cardDrawn.GetIndex());
        cardPicked.SetIdx(move.cardPicked.GetIndex());
        cardDiscarded.SetIdx(move.cardDiscarded.GetIndex());
    }

    void setDiscarded(int index) {
      cardDiscarded.SetIdx(index);
    }

    bool isValid() const {
      if (knock || cardDrawn.GetIndex() < 53 || cardPicked.GetIndex() < 53)
        return true;
      return false;
    }
};

#endif	/* _MOVE_H */

